package com.open.capacity.oss.config;

import com.huawei.saas.interceptor.TenantDomainInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @program: open-capacity-platform
 * @author: GuoGaoJu
 * @create: 2023-03-29
 **/
@Configuration
public class AbsWebMvcConfigurationAdapter extends WebMvcConfigurationSupport {

    @Autowired
    private TenantDomainInterceptor tenantDomainInterceptor;

    //添加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry interceptor) {
        interceptor.addInterceptor(tenantDomainInterceptor).addPathPatterns("/**");
    }
}
